//
//  UIImage+EffectKit.h
//  TestDemo
//
//  Created by fengxijun on 16/6/13.
//  Copyright © 2016年 goappbox. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef struct {
    size_t width;   //宽
    size_t height;  //高
    size_t bitsPerPixel;    //每像素字节数
    size_t bitPerComponent;//   像素每部分长度
    size_t bytesPerRow;
    CGImageAlphaInfo alphaInfo;
    CGBitmapInfo bitmapInfo;
    
}EffectImageAttributes;

@interface UIImage (EffectKit)
- (void)effectedImage:(void(^)(unsigned char *pixels, EffectImageAttributes attributes))effectBlock
          finishBlock:(void(^)(UIImage *image))finishBlock;

- (UIImage *)effectedImageSync:(void(^)(unsigned char *pixels, EffectImageAttributes attributes))effectBlock;

- (UIImage *)maskImage;

-(UIImage *)appendMask:(UIImage *)mask;

/*
 *转换成马赛克,level代表一个点转为多少level*level的正方形
 */
- (UIImage *)mosaicImageWithLevel:(int)level;

/**
 *  增加Alpha通道
 */
- (UIImage *)alphaImage;

- (UIImage *)gaussianBlurImage;

@end
